#-*- coding:utf8 -*-

import os
import sys
import time

def Sleep(wtime):
  print '----------------------- sleep ', wtime
  time.sleep(wtime)

def h():
  print 12
  yield 2
  print 34

def main(argv):
  is_block = int(argv[1]) if len(argv) > 1 else 0
  a = h()
  wait_time = a.next()
  if is_block:
    Sleep(wait_time)

  print '========'
  try:
    a.next()
    print 56
  except StopIteration:
    print 78



if __name__ == '__main__':
  main(sys.argv)


